// 2025/3/5
// https://leetcode.cn/problems/rotate-array/description/?envType=study-plan-v2&envId=top-100-liked
// 轮转数组

class Solution {
    public:
        void rotate(vector<int>& nums, int k) {
            k = k % nums.size();
            reverse(nums.begin(), nums.end());
            reverse(nums.begin(), nums.begin() + k);
            reverse(nums.begin() + k, nums.end());
        }
    };